package com.oracle.oa.action;

import java.util.List;
import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;
import com.oracle.oa.biz.UserInfoBiz;
import com.oracle.oa.biz.impl.UserInfoBizImpl;
import com.oracle.oa.entity.Userinfo;

public class UserinfoAction extends ActionSupport implements SessionAware{

	private Userinfo u;
	private Userinfo u2;
	Map<String, Object> session;
	private UserInfoBiz ubiz;	
	
	public String save(){			
		ubiz.save(u);
		return SUCCESS;		
	}
	public String delete(){
		u=(Userinfo) ubiz.getById(Userinfo.class, u.getUserid());
			ubiz.delete(u);
			return SUCCESS;		
		}
	public String update(){		
		ubiz.update(u2);
		return SUCCESS;		
	}
	public String one(){
		Userinfo u3=(Userinfo) ubiz.getById(Userinfo.class, u.getUserid());
		session.put("userinfo", u3);
		return "lvhen2";
	}
	public String two(){
		Userinfo u4=(Userinfo) ubiz.getById(Userinfo.class, u.getUserid());
		session.put("userinfo", u4);
		return "lvhen3";
	}
	
	public void setSession(Map<String, Object> arg0) {
		this.session=arg0;
	}
	public Userinfo getU() {
		return u;
	}
	public void setU(Userinfo u) {
		this.u = u;
	}
	public Userinfo getU2() {
		return u2;
	}
	public void setU2(Userinfo u2) {
		this.u2 = u2;
	}
	public UserInfoBiz getubiz() {
		return ubiz;
	}
	public void setubiz(UserInfoBiz ubiz) {
		this.ubiz = ubiz;
	}
	public UserInfoBiz getUbiz() {
		return ubiz;
	}
	public void setUbiz(UserInfoBiz ubiz) {
		this.ubiz = ubiz;
	}

	
}
